<script setup>
import { ref, defineProps, defineEmits } from 'vue'
import { getChannelList } from '@/api/article'

defineProps({
  modelValue: {
    type: [String, Number]
  }
})
const emit = defineEmits(['update:modelValue'])
const channelList = ref([])
const GetChannelList = async () => {
  const res = await getChannelList()
  channelList.value = res.data.data
}
GetChannelList()
</script>

<template>
  <el-select
    width="200px"
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
  >
    <el-option
      v-for="item in channelList"
      :key="item.id"
      :label="item.cate_name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>
